setwd("E:/5hmc_file/2_5hmc_yjp_bam/ASM/")
file=read.csv("20201120/at.least.one.AShM.in.DC.add.BF.beta0.add.CCHC.csv",head=T)
filea=read.csv("20201112做汇总表/all.FDR.sig.at.least.one.add.direction.same.diff.csv",head=T)
filea$id=paste(filea$Chr,filea$Start,sep = ":")
filea1=filea[filea$FDR.sig>1,]

file$id=paste(file$Chr,file$Start,sep=":")
file1=file[file$pattern.not.rm.dupl.num.DC>1,]
file2=file1[file1$BF_in_DC>1,]
file3=file1[file1$BF_in_DC>10,]


#思路20210124
test=file[file$pattern.nodupl.num.DC==1&file$pattern.nodupl.num.CC==1&file$pattern.nodupl.num.HC==1,]
test[test$pattern.nodupl.CC=="normal_down_tumor_down",]$pattern.nodupl.CC="normal_down-tumor_down"
test[test$pattern.nodupl.CC=="normal_up_tumor_up",]$pattern.nodupl.CC="normal_up-tumor_up"

test[test$pattern.nodupl.HC=="normal_down_tumor_down",]$pattern.nodupl.HC="normal_down-tumor_down"
test[test$pattern.nodupl.HC=="normal_up_tumor_up",]$pattern.nodupl.HC="normal_up-tumor_up"
test1=test[test$pattern.nodupl.DC==test$pattern.nodupl.CC&test$pattern.nodupl.DC==test$pattern.nodupl.HC,]

#原来的思路是从单发样本里8个pattern取交集，因此这22个位点筛选如下：
test2=file[file$DC.FDR.sig==12,]
test2=test2[test2$pattern.nodupl.num.DC==1,]
